package com.github.xuemingyu.springboot.acticitycloud.driver.file;

/**
 * Created by avatek on 2015/11/5 0005.
 */
public class FileUploadMessage {
    public static final int CODE_ERROR=1;
    public static final int CODE_SUCCESS=0;
    private int error;
    private String url;
    private String message;


    public static FileUploadMessage createError(String msg){
        FileUploadMessage fileUploadMessage = new FileUploadMessage();
        fileUploadMessage.setError(1);
        fileUploadMessage.setMessage(msg);
        return fileUploadMessage;
    }

    public static FileUploadMessage createSuccess(String url){
        FileUploadMessage fileUploadMessage = new FileUploadMessage();
        fileUploadMessage.setError(0);
        fileUploadMessage.setUrl(url);
        return fileUploadMessage;
    }
    public int getError() {
        return error;
    }

    public void setError(int error) {
        this.error = error;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
